package com.example.epic.service.impl;

import com.example.epic.bean.Application;
import com.example.epic.dao.ApplicationDao;
import com.example.epic.service.ApplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ApplicationServiceImpl implements ApplicationService {

    @Autowired
    ApplicationDao applicationDao;

    @Override
    public List<Application> findApplicationByTeacherId(String teacherId) {
        return applicationDao.findApplicationByTeacherId(teacherId);
    }

    @Override
    public List<Application> findApplicationByStudentId(String studentId) {
        return applicationDao.findApplicationByStudentId(studentId);
    }

    @Override
    public void saveApplication(Application application) {
        applicationDao.saveApplication(application);
    }

    @Override
    public void agreeApplication(Integer id) {
        applicationDao.agreeApplication(id);
    }
}
